<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML>
<html>
<head>
	<meta charset="UTF-8">
	<title>pig书屋--用户中心--收藏夹</title>
	<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" media="all">
	<link rel="stylesheet" type="text/css" href="css/qian.css" media="all">
	<script type="text/javascript" src="js/jquery.min.js"></script>
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
	<style type="text/css">
		body .container .content .part1 .right .table .fav{
			border-bottom:solid 1px #888;
		}
	</style>
</head>
<body>
	<div class="container">
		<%@include file="include/top.jsp" %>

		<div class="content" style="margin:0px 10px;">
			<div class="part1 clearfix" style="border-bottom:1px double #AEAEAE;padding:0px 0px 10px 0px;">
				<ul class="breadcrumb" style="margin-bottom:0px;">
				  <li><a href="/home.action">首页</a> <span class="divider">/</span></li>
				  <li class="active">用户中心--收藏夹</li>
				</ul>
				<%@include file="include/userCenter-left.jsp" %>
	            <div class="right pull-left" style="margin-left:50px;width:600px;">
	            	<c:choose>
						<c:when test="${msg=='shopcar'}">
							<div class="alert alert-success">
							  <button type="button" class="close" data-dismiss="alert">&times;</button>
							  <strong>所选商品成功批量放入购物车</strong>
							</div>
						</c:when>
						<c:when test="${msg=='one'}">
							<div class="alert alert-success">
							  <button type="button" class="close" data-dismiss="alert">&times;</button>
							  <strong>所选商品已经放入购物车</strong>
							</div>
						</c:when>
						<c:when test="${msg=='warn'}">
							<div class="alert">
							  <button type="button" class="close" data-dismiss="alert">&times;</button>
							  <strong>请选择要放入购物车的商品</strong>
							</div>
						</c:when>
					</c:choose>
	            	<!-- 内容 -->
	            	<h4 class="parts" style="border-bottom:solid 1px #333;"><i class="icon-heart"></i>收藏夹</h4>
					<table class="table">
						<tbody>
						<c:choose>
							<c:when test="${not empty favList}">
								<form method="post" action="/listIntoShopcar.action">
									<tr>
										<td>商品</td>
										<td>选择</td>
										<td>删除</td>
									</tr>	
									<c:forEach items="${favList}" var="fav">
										<tr>
											<td class="fav">
												<div class="pull-left">
													<a href="/bookDetail.action?id=${fav.book.id}">
														<c:choose>
															<c:when test="${not empty fav.book.pic}">
																<img src="/showPic.action?id=${fav.book.id}" alt="" class="book" style="height:90px;width:68px;">
															</c:when>
															<c:otherwise>
																<img src="/showPic.action?id=1" alt="" class="book" style="height:90px;width:68px;">
															</c:otherwise>
														</c:choose>
													</a>
												</div>
												<div class="info pull-left" style="margin-left:10px;">
													<h4>${fav.book.bookName}</h4>
													<div class="old_money">定　 价：<span class="del" style="text-decoration:line-through;">${fav.book.price}元</span></div>
													<div class="store_money">商 城 价：${fav.book.saleprice}元</div>
													<a class="btn btn-warning" href="/favIntoShopcar.action?id=${fav.book.id}">放入购物车</a>
													<!-- <a class="btn">删除</a> -->
												</div>
												<div class="clear"></div>
											</td>
											<td class="fav" style="width:40px;">
												<input type="checkbox" name="selectedFav" value="${fav.book.id}">
											</td>
											<td class="fav" style="width:40px;">
												<a href="/delFav.action?id=${fav.id}"><i class="icon-remove"></i></a>
											</td>
										</tr>
									</c:forEach>
									<tr>
										<td class="pull-right">
											<button class="btn btn-warning" type="submit">批量放入购物车</button>
										</td>
									</tr>
								</form>	
							</c:when>
							<c:otherwise>
								<div class="alert alert-info">
								  <button type="button" class="close" data-dismiss="alert">&times;</button>
								  <strong>收藏夹为空</strong>
								</div>
							</c:otherwise>
						</c:choose>
						
							<!-- <tr>
								<td style="text-align:right;">
									<div class="pagination">
									  <ul>
									  	<li class="disabled"><a href="#">首页</a></li>
									    <li class="disabled"><a href="#">Prev</a></li>
									    <li class="disabled"><a href="#">1</a></li>
									    <li class="active"><a href="#">2</a></li>
									    <li class="active"><a href="#">3</a></li>
									    <li class="active"><a href="#">Next</a></li>
									    <li class="active"><a href="#">尾页</a></li>
									  </ul>
									</div>
								</td>
							</tr> -->
						</tbody>
					</table>
				</div>
			</div>
		</div>
		
		<%@include file="include/foot.jsp" %>
	</div>
</body>
</html>